Skip to content

Conversation

@maelvls
Copy link
Member

@maelvls maelvls commented Jan 29, 2021

This PR is an attempt at adding https://github.com/jetstack/google-cas-issuer to the Google Marketplace release.

  • should I make sure to have the Prometheus annotations + service as part of this first iterations?
  • still not sure how to manually test that the Google Marketplace release works
  • should we create a default GoogleCASIssuer so that the user can start right away?

@maelvls maelvls mentioned this pull request Feb 1, 2021
Closed
@maelvls
Copy link
Member Author

maelvls commented Feb 1, 2021

Discussed this morning in the standup: should we create a default GoogleCASIssuer so that the user can start right away? @jakexks

Update: this PR does not have any default GoogleCASIssuer, but I did add a default namespace-scoped GoogleCASIssuer in #5

@maelvls
Copy link
Member Author

maelvls commented Feb 3, 2021

Yay! I finally managed to manually test google-cas-issuer when deployed with mpdev install and it works perfectly!

Proof:

% kubectl describe cert demo-certificate
Events:
  Type    Reason     Age   From          Message
  ----    ------     ----  ----          -------
  Normal  Issuing    20s   cert-manager  Issuing certificate as Secret was previously issued by GoogleCASIssuer.cas-issuer.jetstack.io/googlecasissuer-sample
  Normal  Reused     20s   cert-manager  Reusing private key stored in existing Secret resource "demo-cert-tls"
  Normal  Requested  20s   cert-manager  Created new CertificateRequest resource "demo-certificate-v2rwr"
  Normal  Issuing    20s   cert-manager  The certificate has been successfully issued

⚠️ Caveat: I had to put the CRDs in ./templates/crds.yaml. Details in 9a4f70a:

As detailed in 1, CRDs that are applied through the CRD pre-install hook will not ever be updated or upgraded. The Helm documentation reads 4:

The resources that a hook creates are not tracked or managed as part of > the release. Once Tiller verifies that the hook has reached its ready > state, it will leave the hook resource alone. > > Practically speaking, this means that if you create resources in a hook, > you cannot rely upon helm delete to remove the resources. To destroy such > resources, you need to either write code to perform this operation in a > pre-delete or post-delete hook or add "helm.sh/hook-delete-policy" > annotation to the hook template file.

On top of that, it seems to be not possible (after multiple trials) to manage CRDs using Helm 3's crd-install hook using the crds/ folder 2. It seems like the only way would be to bundle crds inside the templates/ like cert-manager has been doing for a while.

Note that installing CRDs using the templates/ way also causes trouble. Rob Percival mentions in 1 that Helm has a problem with the CRD ordering 3 and that the issue has not been fixed yet, which means installing operators like google-cas-issuer breaks when the CRDs are inside templates/.


Final notes:

  • There is no test automation here, but will do them as part of Add smoke tests #5.
  • I added all the necessary documentation on how to test it manually

cc @jakexks

Signed-off-by: Maël Valais <[email protected]>
As detailed in [1], CRDs that are applied through the CRD pre-install hook
will not ever be updated or upgraded. The Helm documentation reads [4]:

> The resources that a hook creates are not tracked or managed as part of
> the release. Once Tiller verifies that the hook has reached its ready
> state, it will leave the hook resource alone.
>
> Practically speaking, this means that if you create resources in a hook,
> you cannot rely upon helm delete to remove the resources. To destroy such
> resources, you need to either write code to perform this operation in a
> pre-delete or post-delete hook or add "helm.sh/hook-delete-policy"
> annotation to the hook template file.

On top of that, it seems to be not possible (after multiple trials) to
manage CRDs using Helm 3's crd-install hook using the crds/ folder [2]. It
seems like the only way would be to bundle crds inside the templates/ like
cert-manager has been doing for a while.

Note that installing CRDs using the templates/ way also causes trouble. Rob
Percival mentions in [1] that Helm has a problem with the CRD ordering [3]
and that the issue has not been fixed yet, which means installing operators
like google-cas-issuer breaks when the CRDs are inside templates/.

[1]: GoogleCloudPlatform/marketplace-k8s-app-tools#303
[2]: https://helm.sh/docs/developing_charts/#defining-a-crd-with-the-crd-install-hook
[3]: helm/helm#2994
[4]: https://v2.helm.sh/docs/developing_charts/#hook-resources-are-not-managed-with-corresponding-releases

Signed-off-by: Maël Valais <[email protected]>
Signed-off-by: Maël Valais <[email protected]>
@@ -0,0 +1,246 @@
{{ if .Values.installCRDs }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That commit message is great. Worth pasting here for the benefit of future maintainers.

README.md Outdated

This will also verify the application using the [Google Cloud Marketplace verification tool](https://github.com/GoogleCloudPlatform/marketplace-k8s-app-tools/blob/c5899a928a2ac8d5022463c82823284a9e63b177/scripts/verify).

[workload-identity]: https://cloud.google.com/kubernetes-engine/docs/how-to/workload-identity
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this goes further up the file where the missing link is?

@jakexks
Copy link
Contributor

jakexks commented Feb 8, 2021

Only saw some minor text changes
/assign @maelvls

maelvls and others added 2 commits February 8, 2021 17:46
Signed-off-by: Maël Valais <[email protected]>
Co-authored-by: Jake Sanders <[email protected]>
Signed-off-by: Maël Valais <[email protected]>
Co-authored-by: Jake Sanders <[email protected]>
@maelvls
Copy link
Member Author

maelvls commented Feb 8, 2021

/unassign

@maelvls maelvls added this to the Beta milestone Feb 9, 2021
@maelvls maelvls self-assigned this Feb 9, 2021
@maelvls
Copy link
Member Author

maelvls commented Feb 9, 2021

/assign @jakexks
😅

@jakexks
Copy link
Contributor

jakexks commented Feb 9, 2021

/lgtm tentative LGTM 😅

Copy link
Member

@wallrj wallrj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed a couple of cloud-build issues with @maelvls and successfully ran the cloud-build verify process.

/lgtm


> Note: although cert-manager's tags are of the form "v1.1.0", we chose to
> use tags of the form "1.1.0" for the Google Marketplace for the sake of
> consistency.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it's a choice. I think GCM enforces that the version be a semver without any prefix.

cat /scripts/dev > "/workspace/cmpt"
chmod +x /workspace/cmpt
cat /scripts/dev > "/workspace/mpdev"
chmod +x /workspace/mpdev
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This breaks the following steps which still refer to cmpt

@jetstack-bot jetstack-bot merged commit aeb2f31 into main Feb 10, 2021
@maelvls maelvls modified the milestones: beta, initial-release Feb 11, 2021
@maelvls maelvls deleted the add-cas-issuer branch November 3, 2021 09:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants